<template>
    <van-nav-bar :title="title" left-text="返回" left-arrow @click-left="backRoute">
        <template #right>
            <van-icon name="ellipsis" size="24" />
        </template>
    </van-nav-bar>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
import { ref, computed } from 'vue'

const route = useRouter()

//点击返回上一级路由
const backRoute = () => {
    route.back()
}

//标题
const title = computed(() => route.currentRoute.value.meta?.title ?? '标题')



</script>

<style lang="less" scoped></style>
